package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.ruoyi.system.bo.ServiceUserBo;
import com.ruoyi.system.handler.ServiceUserFileTypeHandler;
import lombok.Data;
import org.dromara.mpe.annotation.JsonSerializable;
import org.dromara.mpe.autotable.annotation.Column;
import org.dromara.mpe.autotable.annotation.Table;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;


@Data
@Table(value = "tb_work_order", comment = "热力维修工单")
@TableName(autoResultMap = true)
//@AutoRepository
//@AutoMapper
public class TbWorkOrder  implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    public Long id;

    /**
     * 工单编号
     *
     */
    @Column(comment = "工单编号", notNull = true)
    private String workOrderNumber;

    /**
     * 工单图片
     */
    @Column(comment = "工单图片", type = "json")
    @JsonSerializable(typeHandler = JacksonTypeHandler.class)
    private List<String> workOrderPic;

    /**
     * 工单类型
     */
    @Column(comment = "工单类型 1 普通工单 2紧急工单 3投诉工单 4其他工单", defaultValue = "1", notNull = true)
    private String workOrderType;

    /**
     * 工单报修类别
     *  创建字典显示
     */
    @Column(comment = "工单报修类别", defaultValue = "2", notNull = true)
    private String workOrderRepairType;


    /**
     * 工单报修说明
     *
     */
    @Column(comment = "工单报修说明")
    private String workOrderRepairDesc;


    /**
     * 工单类型备注
     *  工单类型为其他时 必填
     */
    @Column(comment = "工单类型备注")
    private String workOrderTypeRemark;

    /**
     * 工单进行状态
     */
    @Column(comment = "工单进行状态 1待派发 2待跟进 3待提交 4待评价 5已完结", defaultValue = "1",  notNull = true)
    private String workOrderState;

//    /**
//     * 工单描述
//     */
//    @Column(comment = "工单描述")
//    private String workOrderDesc;

    /**
     * 工单标志
     */
    @Column(comment = "工单标志")
    private String workOrderSign;

    /**
     * 用户id
     */
    @Column(comment = "用户id")
    private Long customerId;

    /**
     * 用户姓名
     */
    @Column(comment = "用户姓名")
    private String customerName;

    /**
     * 用户供热号
     */
    @Column(comment = "用户供热号", notNull = true)
    private String customerHeatNumber;

    /**
     * 用户地址
     */
    @Column(comment = "用户地址", notNull = true)
    private String customerAddress;

    /**
     * 用户手机号
     */
    @Column(comment = "用户手机号", defaultValue = "+00 00000000", notNull = true)
    private String customerPhone;



    /**
     * 归属服务部
     */
    @Column(comment ="归属服务部")
    private Long serviceDeptId;


    /**
     * 服务人员
     */
//    @Column(comment = "服务人员")
    private String serviceUsername;

    /**
     * 服务人员
     */
    @JsonSerializable(typeHandler = ServiceUserFileTypeHandler.class) // 必须
    @Column(comment = "服务人员", type = "json")
    private List<ServiceUserBo> serviceUser;

    /**
     * 服务人员id
     */
    @Column(comment = "服务人员id")
    private Long serviceUserId;

    /**
     * 备注
     */
    @Column(comment = "跟进服务备注")
    private String serviceRemark;




    // 处理情况


    /**
     * 工单处理结果
     */
    @Column(comment = "工单处理结果")
    private String dealResult;


    /**
     * 维修结束时间
     */
    @Column(comment = "维修结束时间")
    private LocalDateTime repairStartTime;

    /**
     * 维修结束时间
     */
    @Column(comment = "维修结束时间")
    private LocalDateTime repairEndTime;


    /**
     * 工单处理备注
     */
    @Column(comment = "工单处理备注")
    private String dealRemark;

    /**
     * 工单完结图片
     */
    @Column(comment = "工单完结图片", type = "json")
    @JsonSerializable
    private List<String> workOrderCompletePic;

    // 用户评价


    /**
     * 星级评价
     */
    @Column(comment = "星级评价", decimalLength = 1)
    private Double starRatings;

    /**
     * 用户评价
     */
    @Column(comment = "用户评价")
    private String userComment;

    /**
     * 用户评价时间
     */
    @Column(comment = "用户评价时间")
    private Date userCommentTime;

    /**
     * 补充意见
     */
    @Column(comment = "补充意见")
    private String supplementAdvice;

}
